{% extends "DrinkiitBlogBundle::layout.html.twig" %}

{% block suiveur %} <a href="{{ path('admin_index') }}">Accueil</a> > <a href="{{ path('admin_management_operations') }}">Opérations</a> {% endblock %}

{% block content %}
<div id="form1">
<form method="post" {{ form_enctype(form1) }}>
	
	{{ form_errors(form1) }}
	
	<div>
		{{ form_label(form1.operation_utilisateur) }}
		{{ form_errors(form1.operation_utilisateur) }}
		{{ form_widget(form1.operation_utilisateur, { 'separator': '=====' }) }}
	</div>
	
	<div>
		{{ form_label(form1.operation) }}
		{{ form_errors(form1.operation) }}
		{{ form_widget(form1.operation) }}
	</div>
	<input id="submit" type="submit" />
	{{ form_rest(form1) }}
</form>
</div>
<div id="form2">
<form method="post" {{ form_enctype(form2) }}>
	
	{{ form_errors(form2) }}
	
	<div>
		{{ form_label(form2.operation_commande) }}
		{{ form_errors(form2.operation_commande) }}
		{{ form_widget(form2.operation_commande) }}
	</div>
	
	<input id="submit" type="submit" />
	{{ form_rest(form2) }}
</form>
</div>

<table>
	<tr>
		<th colspan="4">Liste des opérations effectuées</th>
	</tr>
	<tr>
		<td>Date</td>
		<td>Somme</td>
		<td>Utilisateur</td>
		<td>Commande</td>
	</tr>
{% for operation in liste %}
    <tr>
		<td>{{ operation.getDate | date("d/m/Y")  }}</td>
		<td>{{ operation.getOperation }} €</td>
		<td>{{ operation.getOperationUtilisateur }}</td>
		<td>{{ operation.getOperationCommande }}</td>
		<td></td>
    </tr>
{% else %}
    <th>Aucun articles</th>
{% endfor %}
</table>

{% endblock %}
